# See http://twistedmatrix.com/documents/8.2.0/core/howto/servers.html

from twisted.internet import reactor
from twisted.internet.protocol import Protocol, Factory

class Echo(Protocol):
	def connectionMade(self):
		print "Client connected"
	def dataReceived(self, data):
		self.transport.write(data) # send back
	def connectionLost(self, reason):
		print "Client disconnected:", reason.value

factory = Factory()
factory.protocol = Echo

reactor.listenTCP(10007 ,factory)
reactor.run()